//
//  DMEmotionToolBarView.swift
//  DM_新浪微博
//
//  Created by Damon.JiAo on 16/3/8.
//  Copyright © 2016年 Demon_JiAo. All rights reserved.
//

import UIKit

class DMEmotionToolBarView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setUpInfo()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setUpInfo(){
        
        addSubview(recentButton)
        addSubview(defaultButton)
        addSubview(emojiButton)
        addSubview(lxhButton)
        
        recentButton.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(self.snp_left)
            make.top.equalTo(self.snp_top)
            make.bottom.equalTo((self.snp_bottom))
            
            make.width.equalTo(defaultButton.snp_width)
        }
        
        defaultButton.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(recentButton.snp_right)
            make.top.equalTo(self.snp_top)
            make.bottom.equalTo(self.snp_bottom)
            
            make.width.equalTo(emojiButton.snp_width)
        }
        
        emojiButton.snp_makeConstraints { (make) -> Void in
            make.left.equalTo(defaultButton.snp_right)
            make.top.equalTo(self.snp_top)
            make.bottom.equalTo(self.snp_bottom)
            
            make.width.equalTo(lxhButton.snp_width)
        }
        
        lxhButton.snp_makeConstraints { (make) -> Void in
            
            make.left.equalTo(emojiButton.snp_right)
            
            make.top.equalTo(self.snp_top)
            make.bottom.equalTo(self.snp_bottom)
            
            make.right.equalTo(self.snp_right)
            
        }

    }
    
    //MARK: -- 懒加载(子控件)
    private lazy var recentButton:UIButton = UIButton(title: "最近", image: "compose_emotion_table_normal", selectedImage: "compose_emotion_table_selected", tag: 10000, target: self, anction: Selector("changeEmoticon"))
    private lazy var defaultButton:UIButton = UIButton(title: "默认", image: "compose_emotion_table_normal", selectedImage: "compose_emotion_table_selected", tag: 10001, target: self, anction: Selector("changeEmoticon"))
    private lazy var emojiButton:UIButton = UIButton(title: "emoji", image: "compose_emotion_table_normal", selectedImage: "compose_emotion_table_selected", tag: 10002, target: self, anction: Selector("changeEmoticon"))
    private lazy var lxhButton:UIButton = UIButton(title: "浪小花", image: "compose_emotion_table_normal", selectedImage: "compose_emotion_table_selected", tag: 10003, target: self, anction: Selector("changeEmoticon"))
}
